package com.capgemini.diabeo.manager;

import java.util.HashMap;
import java.util.Map;

public enum MealStatus {

	LUNCH_TIME("lunchTime"), BREAKFAST("breakfast"), DINNER("dinner"), LUNCH_TIME_MENU(
			"lunchTimeMenu"), BREAKFAST_MENU("breakfastMenu"), DINNER_MENU(
			"dinnerMenu");

	private String value;

	private static final Map<String, MealStatus> lookup = new HashMap<String, MealStatus>();
	static {
		for (MealStatus value : MealStatus.values())
			lookup.put(value.getValue(), value);
	}

	private MealStatus(String value) {
		this.setValue(value);
	}

	public static MealStatus get(String value) {
		return lookup.get(value);
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public MealStatus convert() {
		switch (this) {
		case BREAKFAST:
			return BREAKFAST_MENU;
		case BREAKFAST_MENU:
			return BREAKFAST;
		case DINNER:
			return DINNER_MENU;
		case DINNER_MENU:
			return DINNER;
		case LUNCH_TIME:
			return LUNCH_TIME_MENU;
		case LUNCH_TIME_MENU:
			return LUNCH_TIME;
		default:
			return null;
		}
	}
}
